<?php

/*

Join club (club_join.pro.php)

*/
ob_start();
$rank_check = 1;
include "global.inc.php";
$clubrank_check = 0;
include "club.inc.php";

if ($getclub[private] == 1)
{
	die(header(error("club.php?game=$game&clubid=$clubid","You can't join a private club.")));
}

if ($clubrank > 0)
{
	die(header(error("club.php?game=$game&clubid=$clubid","You are already a member of this club.")));
}

if ($getmemberdata4[id])
{
	die(header(error("club.php?game=$game&clubid=$clubid","You are already a member of a club.")));
}

mysql_query("UPDATE clubs2 SET members = '$getclub[members]+1' WHERE id = '$clubid' AND game = '$game'");
mysql_query("INSERT INTO club_members2 (club,user,position,game) VALUES ('$clubid','$userid','1','$game')");
header(error("club.php?game=$game&clubid=$clubid","Thank you for joining $getclub[name]."));

?>